cant find "IDTSLogging" in "Imports Microsoft.SqlServer.Dts.Runtime"
Hi All
I am calling my packages through a master package and i am using
Imports Microsoft.SqlServer.Dts.Runtime
but i can't set./use
Imports Microsoft.SqlServer.Dts.Runtime.IDTSLogging
and the interesting thing is that i can use
Dim abc As IDTSLogging
but i can't use
Public Overrides Sub Log(ByVal logEntryName As String, ByVal computerName As String, ByVal operatorName As String, _
ByVal sourceName As String, ByVal sourceID As String, ByVal executionID As String, ByVal messageText As String, _
ByVal startTime As Date, ByVal endTime As Date, ByVal dataCode As Integer, ByVal dataBytes() As Byte) Implements IDTSLogging.Log
I get an error on the "IDTSLogging.Log" from the above code, and the error is
Error 4 'Log' cannot implement 'Log' because there is no matching sub on interface 'Microsoft.SqlServer.Dts.Runtime.IDTSLogging'. C:\........\SSIS\9700403662e2402f85452b3780cb105d\ScriptMain.vb 170 119 st_eb95fc2655994d3a9fa7bd2336e3937a
I don't know why i cant use
Imports Microsoft.SqlServer.Dts.Runtime.IDTSLogging
ThanksSincerely SH -- MCITP , MCTS -- Please kindly mark the post(s) that answered your question and/or vote for the post(s).
May 17th, 2012 1:02pm
You can't do this: Imports Microsoft.SqlServer.Dts.Runtime.IDTSLogging
because it is an interface
And you can't override on an interface - there is nothing to override
Chuck
Free Windows Admin Tool Kit Click here and download it now
May 17th, 2012 1:12pm
yes i have a class of ..
Class LogClass
Inherits LogProviderBase
Implements IDTSLogging
' Variables.
Dim _fireAgain As Boolean = True
Dim _PackageID As Int32 = 0
Dim _PackageName As String = String.Empty
Dim _connLogDB As OleDbConnection
Public ReadOnly Property Enabled() As Boolean Implements IDTSLogging.Enabled
Get
Return True
End Get
End Property
Public Function GetFilterStatus(ByRef eventNames() As String) As Boolean() Implements IDTSLogging.GetFilterStatus
' Required for Implement
'Return
End Function
Public Overrides Sub Log(ByVal logEntryName As String, ByVal computerName As String, ByVal operatorName As String, _
ByVal sourceName As String, ByVal sourceID As String, ByVal executionID As String, ByVal messageText As String, _
ByVal startTime As Date, ByVal endTime As Date, ByVal dataCode As Integer, ByVal dataBytes() As Byte) Implements IDTSLogging.Log
'Public Overrides Sub Log(ByVal logEntryName As String, ByVal computerName As String, ByVal operatorName As String, _
'ByVal sourceName As String, ByVal sourceID As String, ByVal executionID As String, ByVal messageText As String, _
'ByVal startTime As Date, ByVal endTime As Date, ByVal dataCode As Integer, ByRef dataBytes() As Byte) Implements IDTSLogging.Log
If String.Compare(_PackageName, sourceName, True) <> 0 Then
Select Case logEntryName
Case "OnPreExecute", "OnPostExecute", "OnProgress"
LogStep(logEntryName, sourceName, startTime, messageText, sourceID)
Case "OnError", "OnWarning"
LogStep(logEntryName, sourceName, startTime, messageText, sourceID)
Case "OnInformation"
If messageText.IndexOf(" wrote ", StringComparison.CurrentCultureIgnoreCase) >= 0 _
AndAlso messageText.IndexOf(" rows", StringComparison.CurrentCultureIgnoreCase) >= 0 Then
LogStep(logEntryName, sourceName, startTime, messageText, sourceID)
End If
End Select
End If
MyBase.Log(logEntryName, computerName, operatorName, sourceName, sourceID, executionID, messageText, startTime, endTime, dataCode, dataBytes)
End Sub
i am getting an error on "IDTSLogging.Log" in the sub "Public
Overrides
Sub Log"
I don't know how to solve itSincerely SH -- MCITP , MCTS -- Please kindly mark the post(s) that answered your question and/or vote for the post(s).
May 17th, 2012 1:18pm
What are you Overriding? it is an interface.
Try Public Sub LogChuck
Free Windows Admin Tool Kit Click here and download it now
May 17th, 2012 1:20pm
I used Public Sub Log and i get the error
'Private Overrides Sub OpenLog()' cannot override 'Public Overridable Sub OpenLog()' because they have different access levels. C:\....\SSIS\11a83966587843afb00bd5ac33bc6d0d\ScriptMain.vb 269 27 st_eb95fc2655994d3a9fa7bd2336e3937a
I am trying to override the SSIS Event so that i can capture the "OnPipelineRowsSent
pkgChild.Execute(Nothing, Nothing, Nothing, logClass, Nothing
to use the override SSIS event you need to use the codes that I had provided,
Am i missing anything?.
Sincerely SH -- MCITP , MCTS -- Please kindly mark the post(s) that answered your question and/or vote for the post(s).
May 17th, 2012 1:27pm
Forget all about IDTSLogging - you don't need it since you are inheriting LogProviderBase. Take a look at this code to see the correct way to do it
https://msftisprodsamples.svn.codeplex.com/svn/Katmai_Trunk/Programming%20Samples/Control%20Flow/EmailLogProvider%20Sample/VB/EmailLogProviderVB/EmailLogProviderVB.vb
Took a while to find a sample that looked correct in VB. Do yourself a favor and switch to c# - you'll find that there is a very high percentage of vb sample code on the web that is not correct, the good examples tend to be in c#.
Chuck
Free Windows Admin Tool Kit Click here and download it now
May 17th, 2012 1:39pm
One of the issues is that ... i have to use ByRef
---------------------------------------------
Public Overrides Sub Log(ByVal logEntryName As String, ByVal computerName As String, ByVal operatorName As String, _
ByVal sourceName As String, ByVal sourceID As String, ByVal executionID As String, ByVal messageText As String, _
ByVal startTime As Date, ByVal endTime As Date, ByVal dataCode As Integer,
ByRef dataBytes() As Byte) Implements IDTSLogging.Log
-------------------------------------------------
I still have to solve the " Public Overrides Sub Log" the overrides
Sincerely SH -- MCITP , MCTS -- Please kindly mark the post(s) that answered your question and/or vote for the post(s).
May 17th, 2012 4:19pm
You can't do this: Imports Microsoft.SqlServer.Dts.Runtime.IDTSLogging
because it is an interface
And you can't override on an interface - there is nothing to override
Chuck
Thanks , good pointSincerely SH -- MCITP , MCTS -- Please kindly mark the post(s) that answered your question and/or vote for the post(s).
Free Windows Admin Tool Kit Click here and download it now
May 17th, 2012 4:19pm
Take a look at the link I provided - it should show the proper way to do it. Since you are really trying to impliment an interface you can get rid of all of the IDTSLogging stuff completely and just override the methods of the class you are inheriting.Chuck
May 17th, 2012 4:22pm
I am not a .NET person I am trying my best, at the same time i am working on something else.
how can i get rid of IDTSLogging ? can you give me an example?
And about C , sorry i have all my codes in VB , to convert them back and test and etc..... it will take for ever, anyways thanks.
Sincerely SH -- MCITP , MCTS -- Please kindly mark the post(s) that answered your question and/or vote for the post(s).
This is the example:
https://msftisprodsamples.svn.codeplex.com/svn/Katmai_Trunk/Programming%20Samples/Control%20Flow/EmailLogProvider%20Sample/VB/EmailLogProviderVB/EmailLogProviderVB.vb
It is doing exactly what you are trying to do.
Basically you just remove every reference to IDTSLogging in your code.Chuck
Free Windows Admin Tool Kit Click here and download it now
May 17th, 2012 4:25pm
So your code becomes:
Class LogClass
Inherits LogProviderBase
' Variables.
Dim _fireAgain As Boolean = True
Dim _PackageID As Int32 = 0
Dim _PackageName As String = String.Empty
Dim _connLogDB As OleDbConnection
Public Overrides Sub Log(ByVal logEntryName As String, ByVal computerName As String, ByVal operatorName As String, _
ByVal sourceName As String, ByVal sourceID As String, ByVal executionID As String, ByVal messageText As String, _
ByVal startTime As Date, ByVal endTime As Date, ByVal dataCode As Integer, ByVal dataBytes() As Byte)
'Public Overrides Sub Log(ByVal logEntryName As String, ByVal computerName As String, ByVal operatorName As String, _
'ByVal sourceName As String, ByVal sourceID As String, ByVal executionID As String, ByVal messageText As String, _
'ByVal startTime As Date, ByVal endTime As Date, ByVal dataCode As Integer, ByRef dataBytes() As Byte)
If String.Compare(_PackageName, sourceName, True) <> 0 Then
Select Case logEntryName
Case "OnPreExecute", "OnPostExecute", "OnProgress"
LogStep(logEntryName, sourceName, startTime, messageText, sourceID)
Case "OnError", "OnWarning"
LogStep(logEntryName, sourceName, startTime, messageText, sourceID)
Case "OnInformation"
If messageText.IndexOf(" wrote ", StringComparison.CurrentCultureIgnoreCase) >= 0 _
AndAlso messageText.IndexOf(" rows", StringComparison.CurrentCultureIgnoreCase) >= 0 Then
LogStep(logEntryName, sourceName, startTime, messageText, sourceID)
End If
End Select
End If
MyBase.Log(logEntryName, computerName, operatorName, sourceName, sourceID, executionID, messageText, startTime, endTime, dataCode, dataBytes)
End Sub
Chuck
May 17th, 2012 4:26pm
I am not a .NET person I am trying my best, at the same time i am working on something else.
how can i get rid of IDTSLogging ? can you give me an example?
And about C , sorry i have all my codes in VB , to convert them back and test and etc..... it will take for ever, anyways thanks.Sincerely SH -- MCITP , MCTS -- Please kindly mark the post(s) that answered your question and/or vote for the post(s).
Free Windows Admin Tool Kit Click here and download it now
May 17th, 2012 4:39pm
I am not a .NET person I am trying my best, at the same time i am working on something else.
how can i get rid of IDTSLogging ? can you give me an example?
And about C , sorry i have all my codes in VB , to convert them back and test and etc..... it will take for ever, anyways thanks.
Sincerely SH -- MCITP , MCTS -- Please kindly mark the post(s) that answered your question and/or vote for the post(s).
This is the example:
https://msftisprodsamples.svn.codeplex.com/svn/Katmai_Trunk/Programming%20Samples/Control%20Flow/EmailLogProvider%20Sample/VB/EmailLogProviderVB/EmailLogProviderVB.vb
It is doing exactly what you are trying to do.
Basically you just remove every reference to IDTSLogging in your code.Chuck
May 17th, 2012 4:43pm
So your code becomes:
Class LogClass
Inherits LogProviderBase
' Variables.
Dim _fireAgain As Boolean = True
Dim _PackageID As Int32 = 0
Dim _PackageName As String = String.Empty
Dim _connLogDB As OleDbConnection
Public Overrides Sub Log(ByVal logEntryName As String, ByVal computerName As String, ByVal operatorName As String, _
ByVal sourceName As String, ByVal sourceID As String, ByVal executionID As String, ByVal messageText As String, _
ByVal startTime As Date, ByVal endTime As Date, ByVal dataCode As Integer, ByVal dataBytes() As Byte)
'Public Overrides Sub Log(ByVal logEntryName As String, ByVal computerName As String, ByVal operatorName As String, _
'ByVal sourceName As String, ByVal sourceID As String, ByVal executionID As String, ByVal messageText As String, _
'ByVal startTime As Date, ByVal endTime As Date, ByVal dataCode As Integer, ByRef dataBytes() As Byte)
If String.Compare(_PackageName, sourceName, True) <> 0 Then
Select Case logEntryName
Case "OnPreExecute", "OnPostExecute", "OnProgress"
LogStep(logEntryName, sourceName, startTime, messageText, sourceID)
Case "OnError", "OnWarning"
LogStep(logEntryName, sourceName, startTime, messageText, sourceID)
Case "OnInformation"
If messageText.IndexOf(" wrote ", StringComparison.CurrentCultureIgnoreCase) >= 0 _
AndAlso messageText.IndexOf(" rows", StringComparison.CurrentCultureIgnoreCase) >= 0 Then
LogStep(logEntryName, sourceName, startTime, messageText, sourceID)
End If
End Select
End If
MyBase.Log(logEntryName, computerName, operatorName, sourceName, sourceID, executionID, messageText, startTime, endTime, dataCode, dataBytes)
End Sub
Chuck
Free Windows Admin Tool Kit Click here and download it now
May 17th, 2012 4:45pm
Link to the complete code and directions for the custom log provider sample
http://msftisprodsamples.codeplex.com/wikipage?title=SS2008!EmailLogProvider%20SampleChuck
May 17th, 2012 5:16pm
Link to the complete code and directions for the custom log provider sample
http://msftisprodsamples.codeplex.com/wikipage?title=SS2008!EmailLogProvider%20SampleChuck
Free Windows Admin Tool Kit Click here and download it now
May 17th, 2012 5:35pm


